package com.bingo.filter.tag;

import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

@Component
public class FilterTagProducer {

    @Autowired
    RocketMQTemplate rocketMQTemplate;

    public void send(String payload) {
        Message<String> message = MessageBuilder.withPayload(payload).build();
        SendResult sendResult = rocketMQTemplate.syncSend("Base:springboot-filter-tag", message);
        System.out.println("sendResult=" +  sendResult);
    }
}
